package com.usf.jprovider.schema.selector.entry;

import com.usf.jprovider.object.JObjectNode;
import com.usf.jprovider.object.env.Environment;
import com.usf.jprovider.tools.RandomTools;

public final class RandomEntry extends AbstractEntrySelector{

	public RandomEntry() {
		super();
	}
	
	@Override
	protected int index(Environment env, JObjectNode node, int size) {
		return RandomTools.randomizeInteger(size);
	}
	@Override
	protected int startIndex(Environment env, JObjectNode node, int size) {
		return 0;
	}
	@Override
	protected int endIndex(Environment env, JObjectNode node, int size) {
		return size - 1;
	}

	@Override
	public String selectField(Environment env, String table, String column) {
		return env.getConnector().selectRandomize(table, column);
	}
	@Override
	public String selectField(Environment env, String table, String column, String queryValue) {
		return env.getConnector().selectRandomize(table, column, queryValue);
	}
	@Override
	public String selectQuery(Environment env, String query) {
		return env.getConnector().selectRandomize(query);
	}
}
	